<?php

namespace App\Entities;

use App\Support\Database\Eloquent\UuidModel;

class VoteGroup extends UuidModel
{
    const TYPE_VOTE = 1;
    const TYPE_QUIZ = 2;

    protected $fillable = [
        'activity_id',
        'order_id',
        'type',
        'title',
        'memo'
    ];

    public function voteCandidate()
    {
        return $this->hasMany(VoteCandidate::class, 'group_id', 'id');
    }

    public function activity()
    {
        return $this->belongsTo(Activity::class, 'activity_id', 'id');
    }
}